html
    include include/header.pug
    script(src='https://webapi.amap.com/maps?v=1.4.2&key=c75741b6f2144f1c55dddbb864d76b4b')

    body
        include include/navbar.pug
        div#container(style='height:900px').col-md-6
            //img(src='/traffic/traffic?level=5&rectangle=113.2618,23.1017;113.3093,23.1407&scale=600000&size[0]=800&size[1]=600')
        div#description.col-md-6
            h2 路况渲染
                h3 接口：/traffic/traffic
                h3 参数
                p /traffic/traffic?level=5&rectangle=113.2618,23.1017;113.3093,23.1407&scale=1600000&size[0]=800&size[1]=600
                p 参考
                    |
                    a(href='http://lbs.amap.com/api/webservice/guide/api/trafficstatus/#road') 高德接口api
        script.
            $.ajax({
                url: '/render/location?center[]=113.28555&center[]=23.1212&scale=600000&size[]=800&size[]=600',
                type: 'get',
                success: function (res) {
                    ne = res.ne;
                    sw = res.sw;
                    init();
                }
            });

            var init = function () {
                var imageLayer = new AMap.ImageLayer({
                    url: '/traffic/traffic?level=5&rectangle=113.2618,23.1017;113.3093,23.1407&scale=600000&size[0]=800&size[1]=600',
                    bounds: new AMap.Bounds(sw, ne),
                    zooms: [13, 18]
                });

                var map = new AMap.Map('container', {
                    resizeEnable: true,
                    center: [113.28555, 23.1212],
                    zoom: 13,
                    layers: [new AMap.TileLayer(), imageLayer]
                });
            }